package cn.zbzcode.hrm.feign.client;

import cn.zbzcode.hrm.doc.CourseDoc;
import cn.zbzcode.hrm.feign.fallback.ESFeignClientFallbackFactory;
import cn.zbzcode.hrm.query.CourseQuery;
import cn.zbzcode.hrm.utils.AjaxResult;
import cn.zbzcode.hrm.utils.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//用来调用ES的Feign接口
@FeignClient(value = "es-server",fallbackFactory = ESFeignClientFallbackFactory.class)
public interface ESFeignClient {

    @RequestMapping(value = "/es/onLineCourse",method = RequestMethod.POST)
    AjaxResult onLineCourse(@RequestBody CourseDoc courseDoc);

    @RequestMapping(value="/offLineCourse/{id}",method= RequestMethod.POST)
    public AjaxResult offLineCourse(@PathVariable("id")Long id);

    //查询课程
    @RequestMapping(value = "/es/searchCourse",method = RequestMethod.POST)
    public PageList<CourseDoc> searchCourse(@RequestBody CourseQuery courseQuery);
}